<% layout("/WEB-INF/view/console/skins/skin_2/layout.html", {}) {
%>
<div class="row">
    <div class="col-md-12">
        <div class="widget-container fluid-height clearfix">
            <div class="widget-content padded clearfix">
                <div class='row'>
                    <div class='col-md-12'>
                        <form name="boAppBanner_form" id="boAppBanner_form" class='form-inline'>
 <!--<div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='Banner类型' >轮播类型：</label>
 <select class="form-control" id="type" name="type">
 <option  value="">请选择...</option>
 	<option  value="banner">轮播</option>
 	<option  value="startPage">启动页</option>
     <option  value="webSiteBanner">官网轮播</option>
 </select>
 </div>-->
 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='排序'  >排序：</label>
 <input  onkeyup='boAppBannerConsoleGrid.enterToQuery(event);' type='text' class='form-control' id='sort' name='sort' placeholder=''>
 </div>
 <div class='form-group col-md-3' style='margin-top: 10px;'>
 <label title='状态' >状态：</label>
 <select class="form-control" id="status" name="status">
 <option  value="">请选择...</option>
 	<option  value="0">不可用</option>
 	<option  value="1">可用</option>
 </select>
 </div>
 
                        </form>
                    </div>
                </div>
                <div class='row'>
                    <div align="center">
                        <button type='button' class='btn btn-default' id='boAppBannerQuerySearch'>查询</button>
                        <button type='button' class='btn btn-default' id='boAppBannerReset'>重置</button>
                    </div>
                </div>
                 <div id="boAppBannerToolbar" class="btn-group">
                              <button type="button" class="btn btn-default" onclick="consoleOpenWindow('boAppBanner','${ctxPath}/console/bo_app_banner/add/${type}','新增')">
                                  <i class="glyphicon glyphicon-plus"></i>
                              </button>
                              <button type="button" class="btn btn-default" onclick='boAppBannerConsoleGrid.delete("id","${ctxPath}/console/bo_app_banner/delete");'>
                                  <i class="glyphicon glyphicon-trash"></i>
                              </button>
                 </div>
                     <div class='row'>
                              <div class='col-md-12'>
                                  <table id="boAppBanner" data-toggle="table"
                                         data-url="${ctxPath}/console/bo_app_banner/json"
                                         data-pagination="true"
                                         data-query-params="boAppBannerLoadParam"
                                         method="post"
                                         data-side-pagination="server"
                                         data-show-refresh="true"
                                         data-show-toggle="true"
                                         data-pagination-loop="false"
                                         data-show-columns="true"
                                         data-toolbar="#boAppBannerToolbar">
                                      <thead>
                                      <tr>
                                           <th data-checkbox="true"></th>
                                            <th data-field='id' data-visible='false'>ID</th>
  <th data-sortable='true' data-field='title'>Banner题目</th>
  <th data-field='bannerImg' data-sortable='true' data-formatter='boAppBannerbanner_imgFormatter'>banner图片</th>
  <th data-sortable='true' data-field='target'>目标地址</th>
  <th data-field='targetType' data-sortable='true' data-formatter='boAppBannertarget_typeFormatter'>跳转类型</th>
<!--  <th data-field='type' data-sortable='true' data-formatter='boAppBannertypeFormatter'>Banner类型</th>-->
  <th data-field='status' data-sortable='true' data-formatter='boAppBannerstatusFormatter'>状态</th>
  <th data-field='id' data-formatter='boAppBannerTableOperate'>操作</th>
 
                                      </tr>
                                      </thead>
                                  </table>
                              </div>
                     </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
     var boAppBannerConsoleGrid =new consoleGrid({table_id:"boAppBanner"});
     boAppBannerConsoleGrid.init();
     function boAppBannerTableOperate(value){
         return "<button type='button' class='btn btn-xs btn-default command-edit' onclick='consoleOpenWindow(\"boAppBanner\",\"${ctxPath}/console/bo_app_banner/edit?id="+value+"\",\"编辑\")'><span class='glyphicon glyphicon-pencil'></span></button> ";
     }
    function boAppBannerLoadParam(params){
        params.query=boAppBannerQueryString();
        return params;
    }
     function boAppBannerQueryString() {
         var objQuery = new Object();
     objQuery.targetType=$('#targetType').val()==''?null:$('#targetType').val();
     objQuery.type="${type!''}";
     objQuery.status=$('#status').val()==''?null:$('#status').val();
 
         var queryString = JSON.stringify(objQuery);
         return queryString;
     }

           function boAppBannerbanner_imgFormatter(value) 
       { 
         return '<a href="'+value+'" target="_blank" > <img style="height:50px;" src="'+value+'" alt="缩略图"> </a>';
       }
 function boAppBannertarget_typeFormatter(value) 
   { 
       var showValue=''; 
       switch(value+''){
       case '0': 
       showValue = '普通网址';
       break;
       case '1': 
       showValue = '商品详情';
       break;
           case '2':
               showValue = '淘宝webView';
               break;
       }
    if(showValue.indexOf('不')!=-1||showValue.indexOf('否')!=-1||showValue.indexOf('禁')!=-1){    
       return '<span class="label label-warning">'+showValue+'</span>';
   }else{
       return '<span class="label label-info">'+showValue+'</span>';
   }
   }
 function boAppBannertypeFormatter(value) 
   { 
       var showValue=''; 
       switch(value+''){
       case 'banner': 
       showValue = 'app轮播';
       break;
       case 'startPage': 
       showValue = '启动页';
       break;
           case 'webSiteBanner':
               showValue = '官网轮播';
               break;

       }
    if(showValue.indexOf('不')!=-1||showValue.indexOf('否')!=-1||showValue.indexOf('禁')!=-1){    
       return '<span class="label label-warning">'+showValue+'</span>';
   }else{
       return '<span class="label label-info">'+showValue+'</span>';
   }
   }
 function boAppBannerstatusFormatter(value) 
   { 
       var showValue=''; 
       switch(value+''){
       case '0':
       showValue = '不可用';
       break;
       case '1': 
       showValue = '可用';
       break;
       }
    if(showValue.indexOf('不')!=-1||showValue.indexOf('否')!=-1||showValue.indexOf('禁')!=-1){    
       return '<span class="label label-warning">'+showValue+'</span>';
   }else{
       return '<span class="label label-info">'+showValue+'</span>';
   }
   }

 </script>
<%} %>
 